package com.gxy.learn.design.model.construction.combination;

import lombok.extern.slf4j.Slf4j;

/**
 * @description: 菜单项类： 叶子节点
 * @author: gaoxueyong
 * @Date: 2022/11/7 21:47
 */
@Slf4j
public class MenuItem extends MenuComponent {

    public MenuItem(String name, int level) {
        super(name,level);
    }

    /**
     * 打印菜单名称方法（包含子菜单和子菜单项）
     *
     * @return void
     * @Author gaoxueyong
     * @Date 9:39 下午 2022/11/7
     * @Param []
     **/
    @Override
    public void print() {
        for(int i=0;i<level;i++){
            System.out.print("--");
        }
        log.info(name);
    }
}
